<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/main.css" />

    <link rel="stylesheet" type="text/css" href="../../css/colleague.css" />

    <script type="text/javascript" src="../../script/api.js"></script>
    <script type="text/javascript" src="../../script/jquery.js"></script>

    <script type="text/javascript" src="../../script/main.js"></script>
</head>
<body>
  <div id="header">
      <div id="back"></div>
      <h3>意见反馈</h3>
  </div>
  <div id="all" style="height:500px;">
    <!-- <div class="kind">
      <div class="kind_span"><span>意见所属类别</span></div>
      <div class="kind_selete">
        <div class="btn-toolbar" role="toolbar">
          <div class="btn-group">
              <button type="button" class="btn btn-default kind_selete_1">bug</button>
           </div>
          <div class="btn-group">
              <button type="button" class="btn btn-default kind_selete_2">产品建议</button>
          </div>
          <div class="btn-group">
              <button type="button" class="btn btn-default kind_selete_3">吐槽</button>
          </div>
          <div class="btn-group">
              <button type="button" class="btn btn-default kind_selete_4">其他</button>
          </div>
        </div>
      </div>
    </div> -->
    <div class="kind">
      <div class="kind_span"><span>反馈标题</span></div>
      <div class="kind_selete">
        <input class="opinion_title" placeholder="请输入标题"/>
      </div>
    </div>
    <div class="feedback">
      <div class="feedback_span"><span>反馈内容</span></div>
      <div class="feedback_content">
        <div class="feedback_content_span">
          <textarea name="feedback_content_span_text" placeholder="反馈bug时，请描述具体操作步骤及问题" style="height:200px;"></textarea>
          <!-- <img src="../../image/add_img.png" alt=""> -->
        </div>
      </div>
    </div>
    <!-- <div class="contact_way">
      <div class="contact_way_span"><span>你的联系方式</span></div>
      <textarea name="contact_way_span_text" class="contact_way_span_text" placeholder="留下邮箱或电话，方便我们联系你哦"></textarea>
    </div> -->
  </div>
  <footer>
    <button class="myBtn" style="font-size:16px;">提交</button>
  </footer>

</body>
<script type="text/javascript">
      // $("img").click(function(){
      //   api.confirm({
      //       title: '反馈图片',
      //       msg: '您想要从哪里选取图片 ?',
      //       buttons: ['拍照', '相册', '取消']
      //   }, function(ret, err) {
      //       var sourceType = 'album';
      //
      //       if (3 == ret.buttonIndex) { // 取消
      //           return;
      //       }
      //
      //       if (1 == ret.buttonIndex) { // 打开相机
      //           sourceType = 'camera';
      //       }
      //
      //       api.getPicture({
      //           sourceType: sourceType,
      //           encodingType: 'png',
      //           mediaValue: 'pic'
      //       }, function(ret, err) {
      //         if(ret.data){
      //           $("img").attr("src", ret.data);
      //           alert(JSON.stringify(ret));
      //             // if (ret) {
      //             //     personalCenter.updateValue({
      //             //         imgPath: ret.data,//相册或者拍照的图片路径
      //             //         userColor:'#000000',
      //             //         subTitleColor:'#000000',
      //             //         count: count
      //             //     });
      //             // }
      //         }
      //       });
      //   });
      //   // $(".feedback_content_span").append("<img src='../image/add_img.png' alt=''>");
      // })
</script>
<script>
  apiready=function(){
    var aid=$api.getStorage("aid");
    $(".myBtn").on('click',function(){
        var opinionContent=$("textarea").val();
        var opinion_title=$(".opinion_title").val();
        var url='/api/feedbacks';
        var data={
            "aid": aid,
            "content": opinionContent,
            "title": opinion_title,
            "createTime":formatDate(new Date(), 'yyyy-MM-ddTHH:mm:ssZ')
          }
        var functionRet=function(ret){
          toast("提交成功","middle");
          closeWin();
        }
        var functionErr=function(err){
        }
        post(url,data,functionRet,functionErr);
    });
  }
</script>
<script>

  $(function(){
    back();
  })
</script>
</html>
